package com.uzai.console.web.wxqaddfriend;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.wxqaddfriend.wxqaddfriendtask.WxqAddFriendTaskDto;
import com.uzai.console.dto.wxqaddfriend.wxqaddfriendtask.WxqAddFriendTaskIdDto;
import com.uzai.console.dto.wxqaddfriend.wxqaddfriendtask.WxqAddFriendTaskQuery;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.sysmaterial.SysMaterialService;
import com.uzai.console.service.wxqaddfriend.WxqAddFriendTaskService;
import com.uzai.console.vo.wxqaddfriend.wxqaddfriendtask.WxqAddFriendTaskVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 微信群添加好友任务
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "微信群添加好友任务",tags = "微信群|微信群添加好友任务")
@ApiSort(31)
@RestController
public class WxqAddFriendTaskController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(WxqAddFriendTaskController.class);

    @Autowired
    private WxqAddFriendTaskService wxqAddFriendTaskService;
    @Autowired
    private SysMaterialService sysMaterialService;

    @ApiOperation(value = "分页查询微信群添加好友任务列表", notes = "分页查询微信群添加好友任务列表", response = WxqAddFriendTaskVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/wxqAddFriendTask/findByPage")
    public Object findWxqAddFriendTaskPage(@RequestBody WxqAddFriendTaskQuery wxqAddFriendTaskQuery){
        return wxqAddFriendTaskService.findWxqAddFriendTaskList(wxqAddFriendTaskQuery);
    }

    @ApiOperation(value = "查询微信群添加好友任务详情", notes = "查询微信群添加好友任务详情", response = WxqAddFriendTaskVo.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("/wxqAddFriendTask/findById")
    public Object findWxqAddFriendTask(@RequestBody WxqAddFriendTaskIdDto wxqAddFriendTaskIdDto){
        return wxqAddFriendTaskService.findWxqAddFriendTask(wxqAddFriendTaskIdDto);
    }

    @SystemLogType(model = SystemModelEnum.WxqAddFriendTask, type = OperationTypeEnum.ADD)
    @ApiOperation(value = "添加微信群添加好友任务", notes = "添加微信群添加好友任务")
    @ApiOperationSupport(order = 3)
    @PostMapping("/wxqAddFriendTask/add")
    public Object addWxqAddFriendTask(@RequestBody WxqAddFriendTaskDto wxqAddFriendTaskDto){
        wxqAddFriendTaskService.addWxqAddFriendTask(wxqAddFriendTaskDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.WxqAddFriendTask, type = OperationTypeEnum.DELETE)
    @ApiOperation(value = "删除微信群添加好友任务", notes = "删除微信群添加好友任务")
    @ApiOperationSupport(order = 6)
    @PostMapping("/wxqAddFriendTask/delete")
    public Object deleteWxqAddFriendTask(@RequestBody WxqAddFriendTaskIdDto wxqAddFriendTaskIdDto){
        wxqAddFriendTaskService.deleteWxqAddFriendTask(wxqAddFriendTaskIdDto);
        return true;
    }

}
